package com.qdlc.p2p.dal.dto;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;
import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.util.DateUtil;

/**
 * 第三方代收 代付 交易记录
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "tpp_trade_log")
public class TppTradeLog implements Serializable {

    public TppTradeLog() {
    }

    /**
     * 构造方法
     *
     * @param tppUserCustId     托管账户ID
     * @param toTppUserCustId   收款账户ID
     * @param money             交易金额 - 平台传输
     * @param amount            交易金额 - 第三方回调
     * @param orderNo           订单号
     * @param tradeStatus       交易状态
     * @param tradeType         交易类型
     * @param serviceType       业务类型
     * @param borrowId          借款标Id
     * @param borrowRepaymentId 还款Id
     * @param splitList         分账信息
     * @param memo              备注
     * @param
     */
    public TppTradeLog(String tppUserCustId, String toTppUserCustId, String identityType, double money, double amount, String orderNo,
                       String tradeStatus, String tradeType, String serviceType, long borrowId,
                       long borrowRepaymentId, String splitList, String memo) {
        this.tppUserCustId = tppUserCustId;
        this.toTppUserCustId = toTppUserCustId;
        this.identityType = identityType;
        this.money = money;
        this.amount = amount;
        this.orderNo = orderNo;
        this.tradeStatus = tradeStatus;
        this.tradeType = tradeType;
        this.serviceType = serviceType;
        this.borrowId = borrowId;
        this.borrowRepaymentId = borrowRepaymentId;
        this.splitList = splitList;
        this.memo = memo;
//        System.out.println("==================== 交易Log=========================: tradeStatus:" + tradeStatus + " tradeType:" + tradeType + " serviceType:" + serviceType);
    }

    /**
     * 构造方法
     *
     * @param tppUserCustId   托管账户ID
     * @param toTppUserCustId 收款账户ID
     * @param identityType    托管账户类型
     * @param money           交易金额
     * @param orderNo         订单号
     * @param tradeStatus     交易状态
     * @param tradeType       交易类型
     * @param serviceType     业务类型
     * @param memo            备注
     */
    public TppTradeLog(String tppUserCustId, String toTppUserCustId, String identityType, double money, String orderNo,
                       String tradeStatus, String tradeType, String serviceType, String memo) {
        super();
        this.tppUserCustId = tppUserCustId;
        this.toTppUserCustId = toTppUserCustId;
        this.identityType = identityType;
        this.money = money;
        this.orderNo = orderNo;
        this.tradeStatus = tradeStatus;
        this.tradeType = tradeType;
        this.serviceType = serviceType;
        this.memo = memo;
        this.addTime = DateUtil.getNow();
    }

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Expose
    private long id;

    /**
     * 托管账户ID
     */
    @Expose
    private String tppUserCustId;

    /**
     * 收款用户账户ID
     */
    @Expose
    private String toTppUserCustId;

    /**
     * 托管账户类型
     */
    @Expose
    private String identityType;

    /**
     * 交易金额 - 平台传输
     */
    @Expose
    private double money;

    /**
     * 交易金额 - 第三方回调
     */
    @Expose
    private double amount;

    /**
     * 订单号
     */
    @Expose
    private String orderNo;

    /**
     * 交易状态
     */
    @Expose
    private String tradeStatus;

    /**
     * 交易类型
     */
    @Expose
    private String tradeType;

    /**
     * 业务类型 tender/loan 等
     */
    @Expose
    private String serviceType;

    /**
     * 借款标Id
     */
    @Expose
    private long borrowId;

    /**
     * 还款Id
     */
    @Expose
    private long borrowRepaymentId;

    /**
     * 分账信息
     */
    @Expose
    private String splitList;

    /**
     * 备注 最好是 Json字符串
     */
    @Expose
    private String memo;

    /**
     * 添加时间
     */
    @Expose
    private Date addTime;

    /**
     * 交易时间
     */
    @Expose
    private Date tradeTime;

    /**
     * 新浪状态
     */
    @Expose
    private String sinaStatus;

    /**
     * 关联订单号
     */
    @Expose
    private String associateOrderId;

    /**
     * 备注
     */
    @Expose
    private String remark;

    /**
     * 自动调度标识 1:自动，0:非自动
     */
    private int autoDispatch;

    /**
     * 获取 主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置 主键
     *
     * @param id
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * 获取 托管账户ID
     *
     * @return
     */
    public String getTppUserCustId() {
        return tppUserCustId;
    }

    /**
     * 设置 托管账户ID
     *
     * @param
     */
    public void setTppUserCustId(String tppUserCustId) {
        this.tppUserCustId = tppUserCustId;
    }

    /**
     * 获取收款用户账户ID
     *
     * @return
     */
    public String getToTppUserCustId() {
        return toTppUserCustId;
    }

    /**
     * 设置收款用户账户ID
     *
     * @param toTppUserCustId
     */
    public void setToTppUserCustId(String toTppUserCustId) {
        this.toTppUserCustId = toTppUserCustId;
    }

    /**
     * 获取 交易金额  - 第三方回调
     *
     * @return
     */
    public double getAmount() {
        return amount;
    }

    /**
     * 设置 交易金额 - 第三方回调
     *
     * @param
     */
    public void setAmount(double amount) {
        this.amount = amount;
    }

    /**
     * 获取 订单号
     *
     * @return
     */
    public String getOrderNo() {
        return orderNo;
    }

    /**
     * 设置 订单号
     *
     * @param
     */
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    /**
     * 获取 交易状态
     *
     * @return
     */
    public String getTradeStatus() {
        return tradeStatus;
    }

    /**
     * 设置 交易状态
     *
     * @param
     */
    public void setTradeStatus(String tradeStatus) {
        this.tradeStatus = tradeStatus;
    }

    /**
     * 获取 交易类型
     *
     * @return
     */
    public String getTradeType() {
        return tradeType;
    }

    /**
     * 设置 交易类型
     *
     * @param
     */
    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    /**
     * 获取 备注 最好是 Json字符串
     *
     * @return
     */
    public String getMemo() {
        return memo;
    }

    /**
     * 设置 备注 最好是 Json字符串
     *
     * @param
     */
    public void setMemo(String memo) {
        this.memo = memo;
    }

    /**
     * 获取 添加时间
     *
     * @return
     */
    public Date getAddTime() {
        return addTime;
    }

    /**
     * 设置 添加时间
     *
     * @param
     */
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取 交易时间
     *
     * @return
     */
    public Date getTradeTime() {
        return tradeTime;
    }

    /**
     * 设置 交易时间
     *
     * @param
     */
    public void setTradeTime(Date tradeTime) {
        this.tradeTime = tradeTime;
    }

    /**
     * 获取 交易金额 - 平台传输
     *
     * @return
     */
    public double getMoney() {
        return money;
    }

    /**
     * 设置 交易金额 - 平台传输
     *
     * @param
     */
    public void setMoney(double money) {
        this.money = money;
    }

    /**
     * 获取 业务类型 tender/loan 等
     *
     * @return
     */
    public String getServiceType() {
        return serviceType;
    }

    /**
     * 设置 业务类型 tender/loan 等
     *
     * @param
     */
    public void setServiceType(String serviceType) {
        this.serviceType = serviceType;
    }

    /**
     * 获取 借款标Id
     *
     * @return
     */
    public long getBorrowId() {
        return borrowId;
    }

    /**
     * 设置 借款标Id
     *
     * @param
     */
    public void setBorrowId(long borrowId) {
        this.borrowId = borrowId;
    }

    /**
     * 获取 还款Id
     *
     * @return
     */
    public long getBorrowRepaymentId() {
        return borrowRepaymentId;
    }

    /**
     * 设置 还款Id
     *
     * @param
     */
    public void setBorrowRepaymentId(long borrowRepaymentId) {
        this.borrowRepaymentId = borrowRepaymentId;
    }

    /**
     * 获取 分账信息
     *
     * @return
     */
    public String getSplitList() {
        return splitList;
    }

    /**
     * 设置 分账信息
     *
     * @param
     */
    public void setSplitList(String splitList) {
        this.splitList = splitList;
    }

    /**
     * 获取 托管账户类型
     *
     * @return
     */
    public String getIdentityType() {
        return identityType;
    }

    /**
     * 设置 托管账户类型
     *
     * @param
     */
    public void setIdentityType(String identityType) {
        this.identityType = identityType;
    }

    public String getSinaStatus() {
        return sinaStatus;
    }

    public void setSinaStatus(String sinaStatus) {
        this.sinaStatus = sinaStatus;
    }

    public String getAssociateOrderId() {
        return associateOrderId;
    }

    public void setAssociateOrderId(String associateOrderId) {
        this.associateOrderId = associateOrderId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getAutoDispatch() {
        return autoDispatch;
    }

    public void setAutoDispatch(int autoDispatch) {
        this.autoDispatch = autoDispatch;
    }
}
